fix(install): write standing settings.system.json snapshot on hooks install (#1402)#1432
Open
sauldataman wants to merge 1 commit into
Open
Conversation
…nstall (danielmiessler#1402) install/settings.system.json is only a merge source; nothing ever wrote a standing copy to ~/.claude/settings.system.json, while MemoryHealthCheck CHECK 3 requires that path to exist and to register the four memory hooks. Every fresh install therefore reported CRITICAL from the first health run. InstallHooks.ts --apply now writes the snapshot (system half + the payload's own hooks -- incoming, not merged, so a user's foreign entries are never frozen into system truth). Dry-run unchanged; idempotent across re-applies. Both the skill source and the install payload mirror are updated, plus the Setup.md step-7 doc line.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Addresses #1402. MemoryHealthCheck.ts CHECK 3 treats ~/.claude/settings.system.json as the standing source of truth for system hook wiring and requires the four memory hooks to be registered in it. But no
install step ever writes that file:
So on a fresh install the health check fails against a file that no step is responsible for creating:
CRITICAL — settings.system.json not found at ~/.claude/settings.system.json
(This is the "never written" variant of the contract gap in #1402; the "written without hooks" variant is the same missing producer seen from the other side.)
Fix
InstallHooks.ts --apply now also writes the standing snapshot to /settings.system.json:
Write-path (join(configRoot, "settings.system.json")) and the health check's read-path (join(HOME, ".claude", "settings.system.json")) resolve to the same location under a normal install; both use
process.env/os.homedir(), so this is not affected by the literal-$HOME issue in #1404.
Scope / semantics
Verification
Sandbox --config-root, then the real consumer with HOME overridden:
$ bun InstallHooks.ts --config-root $SBX --skill-root $SKILL --apply
$ bun InstallHooks.ts --config-root $SBX --skill-root $SKILL --apply
$ HOME=$SBX_HOME bun LIFEOS/TOOLS/MemoryHealthCheck.ts
CHECK 3 findings: none
ok: settings-hook-present:settings.system.json:MemoryReviewTrigger.hook.ts
ok: settings-hook-present:settings.system.json:MemoryReviewFire.hook.ts
ok: settings-hook-present:settings.system.json:MemoryHealthGate.hook.ts
ok: settings-hook-present:settings.system.json:MemoryDeltaSurface.hook.ts
Dry-run writes no snapshot; second --apply is byte-identical to the first.